<!DOCTYPE html>
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery.min.js"></script>
	<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.css">
	<script type="text/javascript" src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="bootstrap-fileinput/css/fileinput.min.css">
	<script type="text/javascript" src="bootstrap-fileinput/js/fileinput.min.js"></script>
	<script type="text/javascript" src="bootstrap-fileinput/js/locales/zh.js"></script>
	<script type="text/javascript" src="bootstrap-fileinput/js/locales/zh-TW.js"></script>
	<link rel="stylesheet" href="bootstrap-table/dist/bootstrap-table.css">
	<script type="text/javascript" src="bootstrap-table/dist/bootstrap-table.js"></script>
	<script type="text/javascript" src="bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
	<script type="text/javascript" src="bootstrap-table/bootbox.js"></script>
	
	<table id="log_table" class="table table-hover"></table>
	
<script>
$(function(){
	$("#log_table").bootstrapTable({
		url: "log/list",//请求地址
        dataField: "rows",//服务端返回数据键值 就是说记录放的键值是rows，分页时使用总记录数的键值为total
        dataType: "json",//期待返回数据类型
        method: "post",//请求方式
        sidePagination: "server",//服务端分页
        queryParams: function (param) {
	     return  {limit: param.limit, offset: param.offset,
	    	 search:param.search,sort:param.sort,order:param.order
	            }; },
        search: true,//是否启用搜索框
        queryParamsType: "limit",//查询参数组织方式
        searchAlign: "right",//搜索框对齐方式
        pagination: true,//是否分页
        pageSize: 10,//单页记录数
        pageList: [10, 20, 30],//分页步进值
        showRefresh: true,//刷新按钮
        showColumns: true,//列选择按钮
        showToggle:true,  //切换格式按钮
        clickToSelect:true,//是否启用点击选中行
        singleSelect:true, //选中行
        selectIds:[],		//选中的行的id号
        toolbarAlign: "left",//工具栏对齐方式
        buttonsAlign: "right",//按钮对齐方式
        locale: "zh-CN", //中文支持
        columns: [
            {title: "全选",field: "select",checkbox: true,width: 20,align: "center",valign: "middle"},
            {title: "ID", field: "id",sortable: true,order: "desc"},//是否可排序
            {title: "用户",field: "username"},
            {title:"登录时间",field: "loginTime"},
            {title: "身份",field: "identity"}
        ]      
	});
});

</script>